package miracle.joker.design.abstract_factory;

public class AbstractFactoryDemo {

    public static void main(String[] args) {
        AbstractGuiFactory guiFactory = null;

        // 在这里根据需要选择使用 DirectXFactory 或 OpenGLFactory
        String platform = "windows"; // or "linux", "mac"

        if (platform.equals("windows")) {
            guiFactory = new DirectXFactory();
        } else if (platform.equals("linux")) {
            guiFactory = new OpenGLFactory();
        }

        // 创建一个窗口并进行操作
        Window window = guiFactory.createWindow();
        window.setTitle("Test Window");
        window.paint();
    }
}
